package it.unicam.cs.cosy.bioshape.core.components.exception;

/**
 * Launched from the {@code Placement} code if the available space is not enough
 * to contain all the desired {@code Entity} objects.
 * 
 * @author Federico Buti
 */
public class NotEnoughSpaceException extends Exception {

	/** Automatically generated serial ID */
	private static final long serialVersionUID = -7102018430619229719L;

	/**
	 * Builds an exception passing the default error argument: there is not
	 * enough space to store the selected {@code Entity} objects.
	 */
	public NotEnoughSpaceException() {
		super("The volume is not enough, please reduce the number of entities"
				+ " or their size. Otherwise, increse the total volume.");
	}

	/**
	 * Builds an exception.
	 * 
	 * @param error
	 *            a {@code String} describing the occurred error
	 */
	public NotEnoughSpaceException(String error) {
		super(error);
	}

	/**
	 * Prints the exception message.
	 * 
	 */
	public void printException() {
		System.out.println(this.getMessage());
	}

}
